How to enable the SIM MFF2 soldered on your BG96 Module with your P-L496G-CELL02


1)Skip this step for Windows10 - Install the STLink driver on your PC as described in the getting started UM2567

2)download X-CUBE-CELLULAR software available at https://www.st.com/en/embedded-software/x-cube-cellular.html

3)Connect the HW discovery board and BG96 Module with its antenna

4)Install the X-CUBE-CELLULAR for BG96 firmware to STM32 as described in the UM2567 section 3.3
l496_bg96_socket_v510.bin

5)Run X-CUBE-CELLULAR as described in UM2567 section 4

Note: check that eSIM is enabled by default as following or select eSIM

5.1) Check the current configuration
=============================
    X-CUBE-CELLULAR
    Version: V5.1.0
=============================
Select the application to run:

1: Setup configuration Menu
2: FAQ display
3: Modem power on (without application)

Or type any key to start
1
--------------------------------
Date: Wed 01/07/2020 - 13:13:18
--------------------------------
   Setup configuration Menu
--------------------------------
Select the action to process:

0: Quit
1: Date/Time setting (RTC)
2: Configuration: Cellular Service
3: Configuration: Echoclient
4: Configuration: Grovestreams
5: Configuration: Ping
8: Status of above configurations
9: Erase all FEEPROM configurations (restore to DEFAULT)
2
------------------------------------
 Cellular Service configuration Menu
------------------------------------
 c : update configuration by console and store it in FEEPROM
 e : erase the configuration stored in FEEPROM (restore to DEFAULT)
 l : list current configuration
 h : help
 q : quit
l
--------------------------------
 Cellular Service from FEEPROM
--------------------------------

Sim Slot 0: 1 (MODEM EMBEDDED SIM)
APN: EM
CID: 1
username:
password:
modem target_state: 2
attachment timeout: 180000 ms
NFMC activation : 0

5.2) If Sim Slot 0: 1 (MODEM SOCKET), select the eSIM
Select option c : update configuration by console and store it in FEEPROM'
 
------------------------------------
 Cellular Service configuration Menu
------------------------------------
 c : update configuration by console and store it in FEEPROM
 e : erase the configuration stored in FEEPROM (restore to DEFAULT)
 l : list current configuration
 h : help
 q : quit
c
--------------------------------
 Cellular Service from UART
--------------------------------

Version: 5
Sim Slot 0: 1 (MODEM EMBEDDED SIM)
APN: EM
CID: 1
username:
password:
modem target_state: 2
attachment timeout: 180000 ms
NFMC activation : 0

New config is written in feeprom (88 bytes) 

6)start the firmware (or just reset the board by pressing to the black button and let the firmware start automatically)

7)Check the trace on the teraterm terminal that Device tries to attach to the network
you will see that AT+CGATT=1 returns an ERROR on the trace


8)Now you need to read the BIC to activate the connectivity

8.1) enter the following command on Teraterm
8.1.1) at at
//you see following result
at at
    ATParser:*** SEND (size=3) ***
at<CR>
    <CR><LF>
    OK<CR><LF

8.1.2) at AT+CRSM=176,12275,0,0,16,,"3F00"
//you see following result
at AT+CRSM=176,12275,0,0,16,,"3F00"
    ATParser:*** SEND (size=33) ***
AT+CRSM=176,12275,0,0,16,,"3F00"<CR>
    <CR><LF>
    +CRSM: 144,0,"314254686578386B753037316462357A"<CR><LF>
    <CR><LF>
    OK<CR><LF>

8.1.3) convert	the BIC in HEX string to ASCII
for example 314254686578386B753037316462357A to ASCII 1BThex8ku071db5z

you can use some online tool to do the conversion.

You can also use Notepad++. Copy/paste the string to Notepad++, select it and use Plugins/Converter/HEX -> ASCII

8.1.4) connect to EMNIFY website to enable the SIM card
8.1.4.1) login to cdn.emnify.net website
create an account if you don't have or log with your existing account

8.1.4.2) when logged in, select the item "Register Your SIM Cards" icon
Enter the BIC code 4 by 4 letters in ASCII format as requested
for example 1BThex8ku071db5z enters 1BTh ex8k u071 db5z

8.1.4.3) Verify BIC
You should see the following text in the menu
	BIC 1BThex8ku071db5z is valid, this batch includes 1 SIM(s)

select the option "I want the SIMs to be activated now" and click on Confirm Registration

Once registered, you can create an end points to monitor your sim card. But from now your SIM card is enabled

9)Once the SIM is activated, reboot the device to attach to the network and run the X-CUBE-CELLULAR examples as described in UM2567









